#define SOFT_ALIGEMENT
#include "miniutil/buf2type.h"
#include "minitest/testcase.h"

#include <iostream>

using namespace miniutil;


class tbuf2type : public testcase
{

public: 
	tbuf2type()
	{
	}

	virtual void test()
	{
		char buf[10];
		for(int i=0; i< sizeof(buf); i++)
		{
			buf[i] = (char)(i&0xff);
		}
		int value = miniutil::GET_NET_INT_VALUE(buf);
		std::cout<<std::hex<<value<<std::endl;
		short svalue = miniutil::GET_NET_SHORT_VALUE(buf+2);
		std::cout<<std::hex<<svalue<<std::endl;

		miniutil::SET_NET_INT_VALUE(buf, 0x5060708);
		for(int i=0; i< sizeof(buf); i++)
		{
			std::cout<<(int)buf[i]<<" ";
		}
	}
};

testcase * testbuf2type = new tbuf2type();
